﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

public partial class Admin_OnLineQuestion : System.Web.UI.Page
{
	string strExpertSessionID = "";
	PX.Chat.ChatComponent clsChatComp = new PX.Chat.ChatComponent();

	protected override void OnInit(EventArgs e)
	{
		base.OnInit(e);

		strExpertSessionID = Session.SessionID.ToString();
	}

	protected void Page_Load(object sender, EventArgs e)
	{
		ShowOnLineQuestion();
	}

	private void ShowOnLineQuestion()
	{
		List<PX.OnLine.OnLine> listOnLineQuestion = new List<PX.OnLine.OnLine>();

		listOnLineQuestion = clsChatComp.QueryOnLineQuestion(strExpertSessionID);

		for (int i = 0; i < listOnLineQuestion.Count; i++)
		{
			HyperLink hLink = new HyperLink();

			hLink.CssClass = "Expert_OnLineQuestion";
			hLink.Target = "_parent";
			hLink.Text = listOnLineQuestion[i].Name;
			hLink.NavigateUrl = "ExpertOnLine.aspx?QuestionSessionID=" + listOnLineQuestion[i].SessionID;

			pOnLineQuestion.Controls.Add(hLink);
		}
	}
}
